#include "PluginMainWindow.h"
#include <QLabel>

PluginMainWindow::PluginMainWindow(QWidget *parent) : QMainWindow(parent) {
    setWindowTitle("插件窗口");
    setMinimumSize(400, 300);
    QLabel *label = new QLabel("这是一个插件窗口", this);
    label->setAlignment(Qt::AlignCenter);
    setCentralWidget(label);
}



// 创建新窗口的方法
QWidget* PluginMainWindow::createWindow(QString filepath,QWidget* parent) {
    //return new PluginMainWindow(parent);
    //QMessageBox::critical(this,"调用提示","生成窗口!");
    if(sD==nullptr)
        sD=new sandLight(this);
    return sD;

}
QString PluginMainWindow::ChineseName(){
    return PluginName;
}

void PluginMainWindow::deleteSomething(){
    if(sD!=nullptr){
        delete sD;
        sD=nullptr;
    }
}

PluginMainWindow::~PluginMainWindow(){
    deleteSomething();
}
